//
//  DCTaskBaseCell.m
//  JiuyaoMotorcade
//
//  Created by 大橙子 on 2018/11/29.
//  Copyright © 2018 Tomous. All rights reserved.
//

#import "DCTaskBaseCell.h"

@implementation DCTaskBaseCell

-(void)setUpBaseCellUI
{
    DCImageAndTextLabel *startLabel = [[DCImageAndTextLabel alloc]init];
    startLabel.imageView.image = IMAGENAME(@"起点");
    self.startLabel = startLabel;
    [self addSubview:startLabel];
    
    DCImageAndTextLabel *extractLabel = [[DCImageAndTextLabel alloc]init];
    extractLabel.imageView.image = IMAGENAME(@"提现");
    self.extractLabel = extractLabel;
    [self addSubview:extractLabel];
    
    DCImageAndTextLabel *endLabel = [[DCImageAndTextLabel alloc]init];
    endLabel.imageView.image = IMAGENAME(@"终点");
    self.endLabel = endLabel;
    [self addSubview:endLabel];
    
    DCImageAndTextLabel *sendLabel = [[DCImageAndTextLabel alloc]init];
    sendLabel.imageView.image = IMAGENAME(@"送");
    self.sendLabel = sendLabel;
    [self addSubview:sendLabel];
    
    self.carLabel = [[DCImageAndTextLabel alloc]init];
    self.carLabel.imageView.image = IMAGENAME(@"立方体");
    //    self.carLabel.textLabel.font = FONT(16);
    [self addSubview:self.carLabel];
    
    self.totalNumLabel = [self getLabelWithFont:14 textAlignment:NSTextAlignmentRight];
    [self addSubview:self.totalNumLabel];
    
    self.numLabel = [self getLabelWithFont:12 textAlignment:NSTextAlignmentLeft];
    self.numLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:self.numLabel];
}
-(void)setUpLayoutSubviews
{
    self.startLabel.frame = CGRectMake(30, 0, (self.width - 30)/3, kBaseHeight-10);
    self.extractLabel.frame = CGRectMake(self.startLabel.right, 0, (self.width - 30)*2/3, self.startLabel.height);
    self.endLabel.frame = CGRectMake(self.startLabel.x, self.startLabel.bottom, self.startLabel.width, self.startLabel.height);
    self.sendLabel.frame = CGRectMake(self.extractLabel.x, self.endLabel.y, self.extractLabel.width, self.startLabel.height);
    
    self.carLabel.frame = CGRectMake(20, self.sendLabel.bottom, 100*WIDTHSCALE6, self.height/3);
    self.totalNumLabel.frame = CGRectMake(self.carLabel.right, self.carLabel.y, 80*WIDTHSCALE6, self.carLabel.height);
    self.numLabel.frame = CGRectMake(self.totalNumLabel.right, self.carLabel.y, self.width - self.carLabel.width - self.totalNumLabel.width, self.carLabel.height);
}


-(UILabel *)getLabelWithFont:(NSInteger)font textAlignment:(NSTextAlignment)textAlignment
{
    UILabel *label = [[UILabel alloc]init];
    label.font = FONT(font);
    label.textAlignment = textAlignment;
    return label;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
